From: Jasper St. Pierre Date: Thu, 11 Sep 2014 23:51:12 +0000 (-0600) Subject: search: Be a bit more careful in _doSearch about timeouts X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~2139 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=9208473e59d800a3bab83ad831d4b72b8d25503b;p=gnome-shell.git search: Be a bit more careful in _doSearch about timeouts --- diff --git a/js/ui/search.js b/js/ui/search.js index 5798a4e91..f4898df3b 100644 --- a/js/ui/search.js +++ b/js/ui/search.js @@ -470,7 +470,15 @@ const SearchResults = new Lang.Class({ this._updateSearchProgress(); + if (this._searchTimeoutId > 0) { + GLib.source_remove(this._searchTimeoutId); + this._searchTimeoutId = 0; + } + }, + + _onSearchTimeout: function() { this._searchTimeoutId = 0; + this._doSearch(); return GLib.SOURCE_REMOVE; }, @@ -502,7 +510,7 @@ const SearchResults = new Lang.Class({ this._updateSearchProgress(); if (this._searchTimeoutId == 0) - this._searchTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 150, Lang.bind(this, this._doSearch)); + this._searchTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 150, Lang.bind(this, this._onSearchTimeout)); }, _onPan: function(action) {